﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml.Serialization;

namespace SSPharma.Common
{
    public class XMLConfig
    {
        public Header Header { get; set; }
        public Database Database {get; set;}

        public static XMLConfig Load()
        {
            using (FileStream fstream = new FileStream("Config.xml", FileMode.Open))
            {
                XmlSerializer serializer = new XmlSerializer(typeof(XMLConfig));

                return (XMLConfig)serializer.Deserialize(fstream);
            }
        }
    }

    public class Header
    {
        public string ORG { get; set; }
        public string DonVi { get; set; }
        public string TenTCT { get; set; }
        public string TenCty_tat { get; set; }
        public string MaKhachHang { get; set; }
        public string DiaChi { get; set; }
        public string DienThoai { get; set; }
        public string Fax { get; set; }
        public string MasoThue { get; set; }
        public string LogoPath { get; set; }
    }

    public class Database
    {
        public string PROVIDER { get; set; }
		public string SERVER { get; set; }
		public string DATABASE { get; set; }
		public string UID { get; set; }
        public string PWD { get; set; }
    }
}
